package com.du.stutestsys.controller.TeacherManage;

import com.du.stutestsys.controller.BaseControler;
import com.du.stutestsys.entity.Chapter;
import com.du.stutestsys.entity.Exercises;
import com.du.stutestsys.service.TeacherManage.ExercisesService;
import com.du.stutestsys.util.DuUtil;
import com.du.stutestsys.util.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Controller
public class ExercisesController extends BaseControler {
    @Autowired
    ExercisesService exercisesService;
    @PostMapping("TeacherManage/addExercises")
    public String addExercises(@RequestBody Exercises exercises,@RequestParam String answers[]){

        return DuUtil.success(exercisesService.addExercises(exercises, answers)).toJSONString();
    }
}
